package com.ruoyi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;

/**
 * 启动程序
 *
 * @author ruoyi
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class RuoYiApplication {
    public static void main(String[] args) {
        long startTime = System.currentTimeMillis();
        // System.setProperty("spring.devtools.restart.enabled", "false");
        //        SpringApplication.run(RuoYiApplication.class, args);
        ConfigurableApplicationContext app = SpringApplication.run(RuoYiApplication.class, args);
        Environment env = app.getEnvironment();

        String port = env.getProperty("server.port");
        String path = env.getProperty("server.servlet.context-path");
        String url = "http://127.0.0.1:" + port + "/" + path + "/";
        long endTime = System.currentTimeMillis();
        long elapsedTime = endTime - startTime;

        System.out.println("ruo-many项目启动时间：" + elapsedTime + "毫秒,ruoyi-fast应用程序已启动，访问地址：" + url);


    }
}